;;; packages - package definitions for GNU Guix
;;; Copyright (C) 2017 ng0
;;;
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU Affero General Public License as
;;; published by the Free Software Foundation, either version 3 of the
;;; License, or (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU Affero General Public License for more details.
;;;
;;; You should have received a copy of the GNU Affero General Public License
;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

(define-module (ng0 packages openssh)
  #:use-module (guix packages)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages xorg)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages kerberos)
  #:use-module (gnu packages groff)
  #:use-module (gnu packages ssh)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages tls))

(define-public sshfs
  (package
    (name "sshfs")
    (version "2.8")
    (source
     (origin
      (method url-fetch)
      (uri (string-append "https://github.com/libfuse/sshfs/releases/"
                          "download/sshfs_" version "/sshfs-"
                          version ".tar.gz"))
      (file-name (string-append name "-" version ".tar.gz"))
      (sha256
        (base32
          "08mdd4rs7yys7hmyig6i08qlid76p17xlvrh64k7wsrfs1s92s3z"))))
    (build-system gnu-build-system)
    (inputs
     `(("fuse" ,fuse)
       ("glib" ,glib)))
    (native-inputs
     `(("pkg-config" ,pkg-config)
       ("openssh" ,openssh)))
    (synopsis "FUSE client based on the SSH File Transfer Protocol")
    (description
     "@code{sshfs} is a filesystem client based on the SSH File Transfer
Protocol.  Since most SSH servers already support this protocol it is very
easy to set up: i.e. on the server side there's nothing to do.  On the
client side mounting the filesystem is as easy as logging into the server
with ssh.
The idea of sshfs was taken from the SSHFS filesystem distributed with LUFS,
which I found very useful.  There were some limitations of that codebase,
so it was rewritten.  Features of this implementation are:
@enumerate
@item Based on FUSE
@item Multithreading: more than one request can be on it's way to the server
@item Allowing large reads (max 64k)
@item Caching directory contents
@item Reconnect on failure
@end enumerate\n")
    (home-page "https://github.com/libfuse/sshfs")
    (license license:gpl2)))
